package com.java2_24;

public class Student1 {
    private String name = "xueshengName";
    int number = 100;
    private int age;

    //内部类就是在类中在创建一个类
    //里面可以调用外边，但是外边不能调用里边
    public class ClassRoom {
        public String name = "xiaoming";
        public int classRoom = number;
        public String teacherName;
        int number2 = 200;

        public void show(String name) {
            System.out.println("这是内部类中的show方法");
            System.out.println(name); //局部优先
            System.out.println(this.name); //调用本类内部
            System.out.println(Student1.this.name); //调用大类的
        }
    }

    //静态只能调用静态方法
    public static class ClassRoom1{
        public static void show(){
            System.out.println("这是静态内部类的方法");
        }
    }

    public Student1(){

    }
    public Student1(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public ClassRoom getClassRoom(){
        return new ClassRoom();
    }
}
